/*
 * Copyright (c) 2017. 深圳一七科技. All rights reserved.
 */

package com.yiqi.liebang.framework.api;

import com.suozhang.framework.entity.bo.Result;

import com.suozhang.framework.entity.bo.UserInfoBo;
import com.yiqi.liebang.entity.LikeUserBo;
import com.yiqi.liebang.entity.bo.*;

import java.util.List;

import cn.rongcloud.contactcard.Friend;
import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.*;


public interface UserApi {

    /**
     * 用户注册
     */
    @POST("v1/login/register_by_phone.shtml")
    Observable<Result<UserInfoBo>> userRegister(@Body RegisterBo registerBo);

    /**
     * 用户登录
     */
    @POST("v1/login/user_login.shtml")
    Observable<Result<UserInfoBo>> userLogin(@Body RegisterBo registerBo);

    /**
     * /**
     * 用户登录
     */
    @POST("v1/login/register_by_third.shtml")
    Observable<Result<UserInfoBo>> thirdLogin(@Body RegisterBo registerBo);

    /**
     * 重置密码
     */
    @POST("v1/login/resetting_password.shtml")
    Observable<Result<UserInfoBo>> userResetPwd(@Body RegisterBo registerBo);

    /**
     * 修改密码
     */
    @POST("v1/login/resetting_password.shtml")
    Observable<Result<String>> editPwd(@Body RegisterBo registerBo);

    /**
     * 修改手机号
     */
    @POST("v1/login/edit_user_phone.shtml")
    Observable<Result<String>> editPhone(@Body RegisterBo registerBo);

    /**
     * 发送验证码
     **/

    @POST("v1/login/getCode.shtml")
    Observable<Result<RegisterBo>> sendCode(@Body RegisterBo registerBo);

    /**
     * 验证验证码
     **/

    @POST("v1/login/Verification_user_code.shtml")
    Observable<Result<String>> verificationUser(@Body RegisterBo registerBo);

    /**
     * 绑定手机号
     **/

    @POST("v1/login/binding_user_phone.shtml")
    Observable<Result<UserInfoBo>> bindPhone(@Body RegisterBo registerBo);

    /**
     * 用户主页
     */
    @POST("v1/userAccountData/get_user_data.shtml")
    Observable<Result<UserCenterBo>> getUserCenter(@Body UserInfoBo registerBo);

    /**
     * 获取个人权限及黑名单
     */

    @POST("v1/message/get_user_privacy.shtml")
    Observable<Result<PrivacyBo>> getPrivacyList();

    /**
     * 修改个人权限及黑名单
     */

    @POST("v1/message/edit_user_privacy.shtml")
    Observable<Result<String>> editPrivacy(@Body EditPrivacyBo privacyBo);

    /**
     * 搜索好友
     */
    @POST("v1/userFriend/search_friend.shtml")
    Observable<Result<FriendBo>> searchFriends(@Body SearchBo searchBo);

    /**
     * 添加好友
     */

    @POST("v1/userFriend/add_user_friend.shtml")
    Observable<Result<String>> getAddFriend(@Body PeopleBo registerBo);

    /**
     * 待处理的好友信息
     */

    @POST("v1/userFriend/get_treated_friend_message.shtml")
    Observable<Result<List<IssuesBo>>> getIssuesList();

    /**
     * 拒绝好友申请
     */

    @POST("v1/userFriend/refuse_user_friend.shtml")
    Observable<Result<String>> getRefuseFriend(@Body IssuesBo peopleBo);

    /**
     * 通过好友申请
     */

    @POST("v1/userFriend/pass_user_friend.shtml")
    Observable<Result<String>> getPassFriend(@Body IssuesBo peopleBo);

    /**
     * 获取好友列表
     */

    @POST("v1/userFriend/get_user_friend.shtml")
    Observable<Result<List<Friend>>> getMyFriendList(@Body PeopleBo peopleBo);

    /**
     * 获取个人名片
     */

    @POST("v1/userAccountData/get_user_visiting_card.shtml")
    Observable<Result<UserCardBo>> getUserVisitingCard();

    /**
     * 喜欢某人
     */

    @POST("v1/userAccountData/add_user_like.shtml")
    Observable<Result<String>> likeUser(@Body LikeUserBo likeUserBo);


    /**
     * 判断是否可以发消息
     */

    @POST("v1/userAccountData/private_letter.shtml")
    Observable<Result<Boolean>> userPrivate(@Body UserInfoBo likeUserBo);


    /**
     * 获取基础认证
     */

    @GET("v1/authentication/get_basic_authentication.shtml")
    Observable<Result<UserCardBo>> getBasicAuthentication();

    /**
     * 判断是否可以发消息
     */

    @POST("v1/authentication/personal_authentication.shtml")
    Observable<Result<String>> toPersonalAuthentication(@Body AllAuthBo likeUserBo);


    /**
     * 修改个人基本信息
     *
     * @param
     * @param
     */
    @Multipart
    @POST("v1/userAccountData/edit_user_visiting_card.shtml")
    Observable<Result<String>> editUserCard(
            @Part MultipartBody.Part userHead,
            @Part("userName") RequestBody userName,
            @Part("userLabelId") RequestBody userLabelId,
            @Part("userIndustry") RequestBody userIndustry,
            @Part("userWorkAddress") RequestBody userWorkAddress,
            @Part("userDetailAddress") RequestBody userDetailAddress,
            @Part("phone") RequestBody userPhone,
            @Part("userEmail") RequestBody userEmail

    );

    /**
     * 提交个人认证信息
     *
     * @param
     * @param
     */
    @Multipart
    @POST("v1/authentication/add_basic_authentication.shtml")
    Observable<Result<String>> editUserCertification(
            @Part MultipartBody.Part userHead,
            @Part("userName") RequestBody userName,
            @Part("userLabelId") RequestBody userLabelId,
            @Part("userIndustry") RequestBody userIndustry,
            @Part("userWorkAddress") RequestBody userWorkAddress,
            @Part("userDetailAddress") RequestBody userDetailAddress,
            @Part("phone") RequestBody userPhone,
            @Part("userEmail") RequestBody userEmail,
            @Part("weChatId") RequestBody weChatId,
            @Part("userCardId") RequestBody userCardId,
            @Part MultipartBody.Part userCardUrl

    );


    /**
     * 提交个人认证信息
     *
     * @param
     * @param
     */
    @Multipart
    @POST("v1/authentication/upload_authentication__image.shtml")
    Observable<Result<String>> uplaodBasicInfo(
            @Part MultipartBody.Part userHead,
            @Part("userName") RequestBody userName,
            @Part("userLabelId") RequestBody userLabelId,
            @Part("userIndustry") RequestBody userIndustry,
            @Part("userWorkAddress") RequestBody userWorkAddress,
            @Part("userDetailAddress") RequestBody userDetailAddress,
            @Part("phone") RequestBody userPhone,
            @Part("userEmail") RequestBody userEmail,
            @Part("weChatId") RequestBody weChatId,
            @Part("userCardId") RequestBody userCardId,
            @Part("uploadType") RequestBody uploadType,
            @Part MultipartBody.Part userCardImage

    );


    /**
     * 添加话题
     */

    @POST("v1/topic/add_topic.shtml")
    Observable<Result<String>> addTopic(@Body AddTopicBo addTopicBo);


    /**
     * 编辑话题
     */

    @POST("v1/topic/modify_topic.shtml")
    Observable<Result<String>> editTopic(@Body AddTopicBo addTopicBo);
    /**
     * 删除话题
     */

    @POST("v1/topic/remove_topic.shtml")
    Observable<Result<String>> delTopic(@Body AddTopicBo addTopicBo);


    /**
     * 添加工作经历
     */
    @Multipart
    @POST("v1/userAccountData/add_occupation_authentication.shtml")
    Observable<Result<String>> addWork(
            @Part MultipartBody.Part comLogo,
            @Part("company") RequestBody company,
            @Part("position") RequestBody position,
            @Part("beginTime") RequestBody beginTime,
            @Part("endTime") RequestBody endTime,
            @Part("describeInfo") RequestBody describeInfo
    );

    /**
     * 修改工作经历
     */
    @Multipart
    @POST("v1/userAccountData/edit_occupation_authentication.shtml")
    Observable<Result<String>> editWork(
            @Part("id") RequestBody id,
            @Part MultipartBody.Part comLogo,
            @Part("company") RequestBody company,
            @Part("position") RequestBody position,
            @Part("beginTime") RequestBody beginTime,
            @Part("endTime") RequestBody endTime,
            @Part("describeInfo") RequestBody describeInfo
    );

    /**
     * 获取单个工作经历
     */
    @POST("v1/userAccountData/get_occupation_authentication.shtml")
    Observable<Result<WorkBo>> getWork(@Body WorkBo addWorkBo);

    /**
     * 获取所有工作经历
     */
    @POST("v1/authentication/get_occupation_authentication.shtml")
    Observable<Result<List<WorkBo>>> getWorkList();
    /**
     * 获取所有工作经历
     */
    @POST("v1/authentication/get_education_authentication.shtml")
    Observable<Result<List<EducationBo>>> getEduList();

    /**
     * 删除工作经历
     */
    @POST("v1/userAccountData/del_occupation_authentication.shtml")
    Observable<Result<String>> deleteWork(@Body WorkBo addWorkBo);

    /**
     * 修改自我介绍
     */
    @POST("v1/userAccountData/edit_user_Introduce.shtml")
    Observable<Result<String>> editIntroduce(@Body IntroduceBo addWorkBo);


    /**
     * 添加教育经历
     */
    @Multipart
    @POST("v1/userAccountData/add_education_authentication.shtml")
    Observable<Result<String>> addEducation(
            @Part MultipartBody.Part eduLogo,
            @Part("schoolName") RequestBody schoolName,
            @Part("subjectName") RequestBody subjectName,
            @Part("diploma") RequestBody diploma,
            @Part("beginTime") RequestBody beginTime,
            @Part("endTime") RequestBody endTime,
            @Part("eduDescribe") RequestBody eduDescribe
    );

    /**
     * 修改教育经历
     */
    @Multipart
    @POST("v1/userAccountData/edit_education_authentication.shtml")
    Observable<Result<String>> editEducation(
            @Part MultipartBody.Part eduLogo,
            @Part("id") RequestBody id,
            @Part("schoolName") RequestBody schoolName,
            @Part("subjectName") RequestBody subjectName,
            @Part("diploma") RequestBody diploma,
            @Part("beginTime") RequestBody beginTime,
            @Part("endTime") RequestBody endTime,
            @Part("eduDescribe") RequestBody eduDescribe
    );
    /**
     * 删除好友
     * */
    @POST("v1/userFriend/delete_user_friend.shtml")
    Observable<Result<String>> deleteUser(@Body RelationshipBo relationshipBo);
    /**
     * 加入黑名单
     * */
    @POST("v1/userFriend/add_user_blackList.shtml")
    Observable<Result<String>> addBlackList(@Body RelationshipBo relationshipBo);
    /**
     * 获取单个教育经历
     */
    @POST("v1/userAccountData/get_education_authentication.shtml")
    Observable<Result<EducationBo>> getEducation(@Body EducationBo educationBo);


    /**
     * 删除教育经历
     */
    @POST("v1/userAccountData/del_education_authentication.shtml")
    Observable<Result<String>> deleteEducation(@Body EducationBo addWorkBo);

    /**
     * 修改生日于家乡
     */

    @POST("v1/userAccountData/edit_user_HomeBirth.shtml")
    Observable<Result<String>> editBithday(@Body EditBithBo editBithBo);

    /**
     * 工作经历认证
     */
    @Multipart
    @POST("v1/authentication/add_occupation_authentication.shtml")
    Observable<Result<String>> authWork(
            @Part("id") RequestBody id,
            @Part MultipartBody.Part certificateImage,
            @Part MultipartBody.Part licenseImage,
            @Part MultipartBody.Part workCardImage,
            @Part MultipartBody.Part visitingImage

    );

    /**
     * 教育经历认证
     *
     * @param DiplomaImage 毕业证
     * @param degreeImage  学位证
     */
    @Multipart
    @POST("v1/authentication/add_education_authentication.shtml")
    Observable<Result<String>> authEducation(
            @Part("id") RequestBody id,
            @Part MultipartBody.Part DiplomaImage,
            @Part MultipartBody.Part degreeImage

    );

    /**
     * 提交审核图片
     */
    @Multipart
    @POST("v1/authentication/upload_authentication__image.shtml")
    Observable<Result<String>> uploadAuthenticationImage(
            @Part("authenticationId") RequestBody id,
            @Part("uploadType") RequestBody uploadType,
            @Part MultipartBody.Part image

    );

    /**
     * 获取优惠券
     */

    @POST("v1/coupon/get_coupon.shtml")
    Observable<Result<List<CouponBo>>> getCoupon(@Body PageBo editBithBo);

    /**
     * 评论用户
     */

    @POST("v1/userAccountData/add_user_comment.shtml")
    Observable<Result<String>> userComment(@Body CommentBo commentBo);

    /**
     * 点赞评论
     */

    @POST("v1/userAccountData/give_user_comment.shtml")
    Observable<Result<String>> zanComment(@Body CommentBo commentBo);

    /**
     * 点赞标签
     */

    @POST("v1/userAccountData/give_user_classify.shtml")
    Observable<Result<String>> zanLabel(@Body CommentBo commentBo);


    /**
     * 提交个人认证信息
     *
     * @param
     * @param
     */
    @Multipart
    @POST("v1/authentication/add_mechanism_authentication.shtml")
    Observable<Result<String>> organizationCertification(
            @Part("mechanismName") RequestBody mechanismName,
            @Part("fullName") RequestBody fullName,
            @Part("contactsName") RequestBody contactsName,
            @Part("contactsPosition") RequestBody contactsPosition,
            @Part("contactsPhone") RequestBody contactsPhone,
            @Part("email") RequestBody email,
            @Part("city") RequestBody city,
            @Part("region") RequestBody region,
            @Part MultipartBody.Part userCardUrl

    );

    /**
     * 获取认证结果
     */
    @POST("v1/authentication/get_mechanism_authentication.shtml")
    Observable<Result<OrganizationBo>> getOrganizationInfo();
    /**
     * 获取访客记录
     * */
    @POST("v1/message/get_Visitor_record.shtml")
    Observable<Result<List<VisitorBo>>> getVisitorRecord(@Body PageBo pageBo);

    /**
     * 获取个人信息
     * */
    @POST("v1/userAccountData/get_user.shtml")
    Observable<Result<UserDataBo>> getMineInfo();

    /**
     * 获取服务协议
     * */
    @POST("v1/Userprotocol/agreement.shtml")
    Observable<Result<String>> getServiceAgreement();

    /**
     * 他人好友
     * */

    @POST("v1/userFriend/get_otherUser_friend.shtml")
    Observable<Result<List<Friend>>> getOtherFriendList(@Body PeopleBo peopleBo);

    /**
     *获取未处理事项数量
     * **/

    @GET("v1/message/user_treated_num.shtml")
    Observable<Result<String>> getUserTreatedNum();

    /**
     * 是否是好友
     * */

    @POST("v1/userFriend/is_friend.shtml")
    Observable<Result<String>> isFriend(@Body OtherUserId peopleBo);


    /**
     * 信息中心
     * */

    @POST("v1/message/message_center.shtml")
    Observable<Result<List<MessageBo>>> getMessageCenter(@Body PageBo peopleBo);

}
